package com.hxk.amqp.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * rabbitMq配置类
 */
@Configuration
public class RabbitConfig {

    /**
     * 设置rabbitMq的消息转换器为json转换器
     * @return
     */
    @Bean
    public MessageConverter messageConverter() throws Exception{
        return new Jackson2JsonMessageConverter();
    }
}
